﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="RequestDevice.aspx.cs" Inherits="Admin_RequestDevice" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="PFO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">    
    <div align="center">
        <div style="font-size:x-large;text-align:left">Request Device :</div>
        <div>            
            <table cellpadding="4" cellspacing="5" border="0">
                <tr>
                    <td align="left">From</td>
                    <td align="left">
                        <asp:TextBox ID="FromDate" runat="server" Width="100px"></asp:TextBox>
                        &nbsp;<img id="Img1" alt="cal" runat="server" src="~/Resources/Images/calendar.gif" />
                        <PFO:CalendarExtender DefaultView="Days" ID="CalEmptyFromDate" runat="server" Format="yyyy/MM/dd" TargetControlID="FromDate"  PopupButtonID="Img1" ></PFO:CalendarExtender> 
                        
                        <%--<PFO:MaskedEditExtender ID="MaskedEditExtendertxtFromDate" runat="server"  TargetControlID="FromDate" MaskType ="Date" Mask = "99/99/9999"
                            CultureName = "en-GB" ErrorTooltipEnabled = "true" >
                         </PFO:MaskedEditExtender> --%>
                    </td>
                    <td align="left" style="padding-left:20px">To</td>
                    <td align="left">
                        <asp:TextBox ID="ToDate" runat="server" Width="100px"></asp:TextBox>
                        &nbsp;<img id="Img2" alt="cal" runat="server" src="~/Resources/Images/calendar.gif" />
                        <PFO:CalendarExtender DefaultView="Days"  ID="CalendarToDate" runat="server" Format="yyyy/MM/dd" TargetControlID="ToDate"  PopupButtonID="Img2"></PFO:CalendarExtender>
                        <%--<PFO:MaskedEditExtender ID="MaskedEditExtender1" runat="server"  TargetControlID="ToDate" MaskType ="Date" Mask = "99/99/9999"
                            CultureName = "en-GB" ErrorTooltipEnabled = "true" >
                         </PFO:MaskedEditExtender>  --%>                       
                    </td>
                </tr>
                <tr align="justify">
                    <td align="left">
                        Account Name</td>
                    <td align="left">
                        <asp:TextBox ID="txtAccountName" runat="server" Width="120px"></asp:TextBox>
                    </td>
                    <td align="left" style="padding-left:20px">
                        Username</td>
                    <td align="left">
                        <asp:TextBox ID="txtUserName" runat="server" Width="120px"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <div>
                <asp:Button ID="btSearch" runat="server" Text="Search" 
                    onclick="btSearch_Click" />
            </div>
        </div>
        <div>
            <br />
            <asp:RadioButtonList ID="rbl_RequestStatus" DataTextField="RequestStatusName" DataValueField="RequestStatusId"                 
                runat="server" AutoPostBack="True" RepeatDirection="Horizontal" 
                onselectedindexchanged="rbl_RequestStatus_SelectedIndexChanged">
            </asp:RadioButtonList>
        </div>
        <asp:GridView ID="gvRequestDevice" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
            CellPadding="3" AllowPaging="True" PageSize="50" 
            onrowdatabound="gvRequestDevice_RowDataBound" 
            onrowcommand="gvRequestDevice_RowCommand" DataKeyNames="Id" 
            onrowdeleting="gvRequestDevice_RowDeleting">
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="ID" />
                <asp:TemplateField HeaderText="User name">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("user.Username") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("user.Username") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Account name">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("user.Customer.Code") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" 
                            Text='<%# Bind("user.Customer.Code") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Plan">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("Plan.Name") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Plan.Name") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="CPU">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Plan.CPUs") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Plan.CPUs") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="RAM">
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("Plan.RAM") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Plan.RAM") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Dist Quota">
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("Plan.DiskQuota") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("Plan.DiskQuota") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Operation System">
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("OS.Name") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("OS.Name") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="RequestDate" HeaderText="Accept Request Date" 
                    DataFormatString="{0:d}" />
                <asp:BoundField DataField="RequestStatusName" HeaderText="Status" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink runat="server" ID="hplSet" NavigateUrl='<%# "~/Admin/AddDevice.aspx?RequestDeviceId=" +Eval("Id")+"&user="+Eval("user.Username")+"&acc="+Eval("user.Customer.Code") %>'>Set</asp:HyperLink>
                    </ItemTemplate>
                    <HeaderStyle Width="35px" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtDelete" runat="server" CommandName="Delete" CommandArgument='<%# Bind("Id") %>'
                            onclientclick="return confirm('Are you sure you want to delete?');">Delete</asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle Width="35px" />
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>
    </div>
</asp:Content>

